# !/usr/bin/env python
# -*- coding: utf-8 -*-

"""
-------------------------------------------------
   File Name：     run
   Description :   
   Author :       崔术森
   date：          2025/6/27
-------------------------------------------------
   Change Activity:
                   2025/6/27 20:48: 
-------------------------------------------------
"""
__author__ = '崔术森'

import ctypes
import datetime
import sys

from PySide2.QtCore import QCoreApplication, Qt
from PySide2.QtGui import QIcon

from src.controller.launch_controller import LaunchController
from PySide2.QtWidgets import QApplication
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID("Css")

from src.utils import resource_path
if __name__ == '__main__':
    current_time = datetime.datetime.now()
    target_date = datetime.datetime(2025, 11, 30)
    print(f"当前时间: {current_time.strftime('%Y-%m-%d %H:%M:%S')}")
    print(f"目标日期: {target_date.strftime('%Y-%m-%d')}")
    # 检查当前时间是否大于目标日期
    if current_time > target_date:
        print("当前时间已超过2025-09-30，程序将退出。")
        sys.exit(0)
    else:
        print("当前时间未超过2025-09-30，程序继续运行。")
    QCoreApplication.setAttribute(Qt.AA_EnableHighDpiScaling, True)
    QCoreApplication.setAttribute(Qt.AA_UseHighDpiPixmaps, True)
    qss = open(resource_path('style/style.qss'), encoding='utf-8').read()
    app = QApplication(sys.argv)
    app.setWindowIcon(QIcon(resource_path("imgs/ico.ico")))
    app.setStyleSheet(qss)
    win = LaunchController()
    win.show()

    sys.exit(app.exec_())